<%DIRECTIVE DYNAMIC;%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title" >修改</h5>
</div>

            <form id="eidtForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/affiche/editDo" method="post">
                  <div class="modal-body ">
                <input type="hidden" name="id" value="${obj.affiche.id!}"/>
                <input type="hidden" name="createAt" value="${obj.affiche.createAt!}"/>
                <input type="hidden" name="putAt" value="${obj.affiche.putAt!}"/>
                <div class="row mb10">
                    <div class="col-lg-12">
                    	<div class="form-group">
                            <label for="region_id" class="col-sm-2 control-label">选择片区</label>
							
                            <div class="col-sm-8">
                                <select id="region_id" name="region_id" class="form-control" required="required">
                                	<%for(region in obj.regions){%>
                                		 <option value="${region.id}" <% if(obj.affiche.region_id==region.id){ %> selected="selected" <% } %>>${region.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="type" class="col-sm-2 control-label">选择类型</label>

                            <div class="col-sm-8">
                                <select id="type" name="type" class="form-control" required="required">
                                	<option value="0" <% if(obj.affiche.type==0){ %> selected="selected" <% } %>>官方公告</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="title" class="col-sm-2 control-label">标题</label>

                            <div class="col-sm-8">
                                <input type="text" id="title" class="form-control" name="title"  placeholder="标题" value="${obj.affiche.title!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">简介</label>

                            <div class="col-sm-8">
                                <input type="text" id="remark" class="form-control" name="remark"  placeholder="简介" value="${obj.affiche.remark!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="link" class="col-sm-2 control-label">链接</label>

                            <div class="col-sm-8">
                                <input type="text" id="link" class="form-control" name="link"  placeholder="链接" value="${obj.affiche.link!}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="state" class="col-sm-2 control-label">状态</label>

                            <div class="col-sm-8">
                                 <input type="radio" name="state" data-parsley-required="true" value="0" <% if(obj.affiche.state ==0){%>checked="checked"<%}%> />启用
                                 <input type="radio" name="state" data-parsley-required="true" value="1" <% if(obj.affiche.state ==1){%>checked="checked"<%}%> />禁用
                            </div>
                        </div>
                    </div>
                </div>
                </div>
	<div class="modal-footer">
		<button  class="btn btn-default btn-sm btn-parsley"  >完成</button> 
	</div>
            </form>
<script language="JavaScript">

$(document).ready(function () {
	var dialog=$("#editModal");
	$("#editModalDialog").draggable();
    $('#eidtForm').ajaxForm({
        dataType: 'json',
        beforeSubmit: function (arr, form, options) {
        },
        success: function (data, statusText, xhr, form) {
            if (data.code == 0) {
                Toast.success(data.msg);
                datatable.ajax.reload();
               	dialog.modal("hide");
            } else {
                Toast.error(data.msg);
                datatable.ajax.reload();
             	dialog.modal("hide");
            }
        }
    });
});
</script>
